# -*- coding: utf-8 -*-
"""
@author: wyb
@date: 2023/12/14
@time: 21:20
@desc: Description
"""
import os.path

from PIL import Image, ImageDraw, ImageFont

im = Image.new('RGBA', (200, 200), 'white')
draw = ImageDraw.Draw(im)

# draw.line([(0, 0), (199, 0), (199, 199), (0, 199), (0, 0)], fill='red', width=4)
# draw.rectangle((20, 30, 60, 60), fill='blue')
# draw.ellipse((120, 30, 160, 160), fill='green')
#
# draw.polygon(((57, 87), (79, 62), (94, 85), (120, 90), (103, 113)), fill='brown')
#
# for i in range(100, 200, 10):
#     draw.line([(i, 0), (200, i - 100)], fill='gray')
# im.save('drawing.png')

draw.text((20, 150), 'hello', fill='purple')
fontsFolder = "C:\Windows\Fonts"
arialFont = ImageFont.truetype(os.path.join(fontsFolder, 'arial.ttf'), 32)
draw.text((100, 150), 'Howdy', fill='gray', font=arialFont)
im.save('text.png')
